# -*- coding: utf-8 -*-
import scrapy


class DadaylSpider(scrapy.Spider):
    name = 'dadayl'
    allowed_domains = ['dadayl.com']
    start_urls = ['http://dadayl.com/']

    def parse(self, response):
        # print(response.body())
        # pass
        content = response.xpath('//*[@id="newslist"]/div[2]/ul/li')
        for i in content:
            temp = {}
            temp['title'] = content.xpath('./a[2]').get()
            temp['url'] = content.xpath('./a[2]/@href').get()
            # print(temp)
            yield temp
